package org.jarge.fundAssistant.util;

import java.util.Map;
import java.util.Set;

import org.htmlparser.Node;
import org.htmlparser.NodeFilter;
import org.jarge.fundAssistant.enties.Fund;
import org.jarge.fundAssistant.enties.Sysconf;

public class MyNodeFilter implements NodeFilter{

	Sysconf sysconf;
	
	public boolean accept(Node node) {
		Map<String,Fund> myfunds = sysconf.getFunds();
		boolean isMatch = false;
		Set<String> keyset = myfunds.keySet();
		for (String fundCode : keyset) {
			String id = "itr_"+fundCode;
			if(node.getText().contains(id))
			{
				isMatch = true;
				break;
			}
		}
		return isMatch;
	}

	public Sysconf getSysconf() {
		return sysconf;
	}

	public void setSysconf(Sysconf sysconf) {
		this.sysconf = sysconf;
	}
	
}
